package com.hmy.finance.dal.po.receipt;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.hmy.finance.dal.po.receipt.json.AccountInfoJson;
import com.hmy.finance.dal.po.receipt.json.CustomerContactorJson;
import com.hmy.finance.dal.po.receipt.json.CustomerInfoJson;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 收款核销申请单
 *
 * @TableName receipt_offset_bill
 */
@TableName(value = "receipt_offset_bill", autoResultMap = true)
@Data
public class ReceiptOffsetBillPo implements Serializable {

    /**
     * 主键ID
     */
    @TableId(value = "receipt_offset_bill_id")
    private Long receiptOffsetBillId;

    /**
     * 单据编号
     */
    @TableField(value = "receipt_offset_bill_no")
    private String receiptOffsetBillNo;

    /**
     * 客户ID
     */
    @TableField(value = "customer_id")
    private Long customerId;

    /**
     * 客户ID
     */
    @TableField(value = "customer_name")
    private String customerName;

    /**
     * 客户扩展信息
     */
    @TableField(value = "customer_extension_info", typeHandler = JacksonTypeHandler.class)
    private CustomerInfoJson customerExtensionInfo;

    /**
     * 分摊联系人信息
     */
    @TableField(value = "customer_contactor_extension_infos", typeHandler = JacksonTypeHandler.class)
    private List<CustomerContactorJson> customerContactorExtensionInfos;

    /**
     * 关联凭证信息ID
     */
    @TableField(value = "voucher_id")
    private Long voucherId;

//    /**
//     * 凭证扩展信息
//     */
//    @TableField(value = "voucher_extension_info")
//    private Object voucherExtensionInfo;

    /**
     * 客户以及联系人账户信息，包含当前余额信息以及分摊信息
     */
    @TableField(value = "account_extension_infos", typeHandler = JacksonTypeHandler.class)
    private AccountInfoJson accountExtensionInfos;

    /**
     * 是否分摊，0-否；1-是
     */
    @TableField(value = "is_apportion")
    private Integer isApportion;

    /**
     * 备注信息
     */
    @TableField(value = "remarks")
    private String remarks;

    /**
     * 单据状态
     */
    @TableField(value = "bill_status")
    private Integer billStatus;

    /**
     * 收款日期
     */
    @TableField(value = "receipted_time")
    private LocalDateTime receiptedTime;

    /**
     * 收款金额
     */
    @TableField(value = "receipted_amount")
    private BigDecimal receiptedAmount;

    /**
     * 收款类型
     */
    @TableField(value = "receipted_type")
    private Integer receiptedType;

    /**
     * 驳回意见
     */
    @TableField(value = "rejected_opinion")
    private String rejectedOpinion;

    /**
     * 销售经理ID
     */
    @TableField(value = "sale_manager_id")
    private Long saleManagerId;

    /**
     * 销售经理姓名
     */
    @TableField(value = "sale_manager_name")
    private String saleManagerName;

    /**
     * 销售经理所属部门ID
     */
    @TableField(value = "sale_manager_dept_id")
    private Long saleManagerDeptId;

    /**
     * 流程实例Id
     */
    @TableField(value = "process_instance_id")
    private String processInstanceId;


    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 创建人ID
     */
    @TableField(value = "creator_id")
    private Long creatorId;

    /**
     * 创建人姓名
     */
    @TableField(value = "creator_name")
    private String creatorName;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 更新人ID
     */
    @TableField(value = "updater_id")
    private Long updaterId;

    /**
     * 更新人姓名
     */
    @TableField(value = "updater_name")
    private String updaterName;

    /**
     * 是否删除，0-否；1-是
     */
    @TableLogic
//    @TableField(value = "is_deleted")
    private Integer isDeleted;

}